//全局设置超时时间为3s
axios.defaults.timeout = 3000

function axios_get(url,params,then,error)
{
    axios.get(url,{params:params}).then(function(response){
        then(response)
	}).catch(function(e){
        error(e)
	})
}

function axios_post(url,data,then,error)
{
   var post_data = new FormData()

   for(var key in data)
   {
    	post_data.append(key,data[key])
   }
   axios.post(url,post_data).then(function(response){
        then(response)
   }).catch(function(e){
        error(e)
   })
}